<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<body>
<div>
    <from enctype="multipart/form-data">
        <div class="upload">
            <button onclick="changeFile()">点击上传</button>
            <input name=""  type="file" style="width: 200px"  id="fileDoms"/>
        </div>
    </from>


</div>
</body>

<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/qianya/js/ry-ui.js?v=4.7.3}"></script>
<script th:src="@{/js/cron.js}"></script>
<script th:inline="javascript">
    function changeFile(){
        var fd = new FormData();
        fd.append("file", document.getElementById("fileDoms").files[0]);
        $.ajax({
            type: 'POST',
            url: "/system/upload/file",
            data: fd,
            processData: false,   // jQuery不要去处理发送的数据
            contentType: false,   // jQuery不要去设置Content-Type请求头
            success: function(res){

            }
        });
    }

</script>
</body>
</html>